home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Scheduling / Cassandra / Source / TextWindow.h < prev    next >
Encoding:
Text File  |  1990-10-27  |  2.0 KB  |  64 lines

  1. //
  2. // TextWindow.h
  3. // Copyright (c) 1990 by Jiro Nakamura 
  4. // All rights reserved
  5. //
  6. // Handles a window with a scroll view in it, opens it with a filename,
  7. // lets the user modify it,
  8. //  and if anything changes, lets she or he save it before
  9. // closing it.
  10. //
  11. // RCS Information
  12. // Revision Number->    $Revision: 2.7 $
  13. // Last Revised->    $Date: 90/10/27 17:53:40 $
  14. //
  15.  
  16. #import <appkit/Window.h>
  17. #import <appkit/Text.h>
  18. #import "cass.h"        // For default fontsize/name and AUTOSAVE
  19.  
  20. // If AUTOSAVE is defined, then windows will automatically save themselves
  21. // on closing. The window close button will not change on window modification
  22. // (as this is somewhat confusing). 
  23.  
  24. @interface TextWindow:Window
  25. {
  26.     #ifdef AUTOSAVE
  27.     // Don't call this docEdited since it will conflict with
  28.     // the real docEdited (this is a fake one)
  29.     BOOL    hasChanged;    
  30.     #endif
  31.  
  32.     const    char *filename;
  33.     const    char *windowIcon;    // The icon used for the miniturization
  34.  
  35.     Text *textView;            // The docView of textScroll
  36.  
  37.     id    textScroll;        // Set by IB. Our scrolling area
  38. }
  39. + new;                // Create ourself and set default values
  40. - free;                // Free ourself
  41.  
  42. - openWith: (const char *) file;    // Open ourself with this filename
  43. - update;                // Update our display (reread filename)
  44. - close;                // Close our display
  45. - save;                    // Save our contents to filename
  46.  
  47. - setFilename: (const char *) file;    // Set the current filename to file
  48. - setWindowIcon: (const char *) name;    // Set the current window icon
  49.  
  50. - setDocEdited: (BOOL) value;        // These may or may not call their
  51. - (BOOL) isDocEdited;            // superclass functions
  52.  
  53. - (const char *) filename;        // Access the current filename
  54. - (const char *) windowIcon;        // Access the current windowIcon
  55.  
  56. - selectTextEnd: sender;        // Select the end of the file.
  57.                     
  58. // We are the delegate of ourself (don't forget that!)
  59. // Catch delegate methods so that we can tell if the user has changed
  60. // anything (inserted/deleted material or changed the font).
  61. - textDidChange : object;        // the user has changed the text                    
  62. - textWillConvert:textObject fromFont:from toFont:to; // Changed the font
  63. @end
  64.